Integrand size = 14, antiderivative size = 108 \[ \int (c+d x) \tan ^3(a+b x) \, dx=\frac {d x}{2 b}-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {i d \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b^2}-\frac {d \tan (a+b x)}{2 b^2}+\frac {(c+d x) \tan ^2(a+b x)}{2 b} \]
[Out]
Time = 0.14 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3801, 3554, 8, 3800, 2221, 2317, 2438} \[ \int (c+d x) \tan ^3(a+b x) \, dx=-\frac {i d \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b^2}-\frac {d \tan (a+b x)}{2 b^2}+\frac {(c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac {(c+d x) \tan ^2(a+b x)}{2 b}+\frac {d x}{2 b}-\frac {i (c+d x)^2}{2 d} \]
[In]
[Out]
Rule 8
Rule 2221
Rule 2317
Rule 2438
Rule 3554
Rule 3800
Rule 3801
Rubi steps \begin{align*} \text {integral}& = \frac {(c+d x) \tan ^2(a+b x)}{2 b}-\frac {d \int \tan ^2(a+b x) \, dx}{2 b}-\int (c+d x) \tan (a+b x) \, dx \\ & = -\frac {i (c+d x)^2}{2 d}-\frac {d \tan (a+b x)}{2 b^2}+\frac {(c+d x) \tan ^2(a+b x)}{2 b}+2 i \int \frac {e^{2 i (a+b x)} (c+d x)}{1+e^{2 i (a+b x)}} \, dx+\frac {d \int 1 \, dx}{2 b} \\ & = \frac {d x}{2 b}-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {d \tan (a+b x)}{2 b^2}+\frac {(c+d x) \tan ^2(a+b x)}{2 b}-\frac {d \int \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b} \\ & = \frac {d x}{2 b}-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {d \tan (a+b x)}{2 b^2}+\frac {(c+d x) \tan ^2(a+b x)}{2 b}+\frac {(i d) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^2} \\ & = \frac {d x}{2 b}-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {i d \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b^2}-\frac {d \tan (a+b x)}{2 b^2}+\frac {(c+d x) \tan ^2(a+b x)}{2 b} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(240\) vs. \(2(108)=216\).
Time = 6.26 (sec) , antiderivative size = 240, normalized size of antiderivative = 2.22 \[ \int (c+d x) \tan ^3(a+b x) \, dx=\frac {d x \sec ^2(a+b x)}{2 b}+\frac {d \csc (a) \left (b^2 e^{-i \arctan (\cot (a))} x^2-\frac {\cot (a) \left (i b x (-\pi -2 \arctan (\cot (a)))-\pi \log \left (1+e^{-2 i b x}\right )-2 (b x-\arctan (\cot (a))) \log \left (1-e^{2 i (b x-\arctan (\cot (a)))}\right )+\pi \log (\cos (b x))-2 \arctan (\cot (a)) \log (\sin (b x-\arctan (\cot (a))))+i \operatorname {PolyLog}\left (2,e^{2 i (b x-\arctan (\cot (a)))}\right )\right )}{\sqrt {1+\cot ^2(a)}}\right ) \sec (a)}{2 b^2 \sqrt {\csc ^2(a) \left (\cos ^2(a)+\sin ^2(a)\right )}}-\frac {d \sec (a) \sec (a+b x) \sin (b x)}{2 b^2}-\frac {1}{2} d x^2 \tan (a)+\frac {c \left (2 \log (\cos (a+b x))+\tan ^2(a+b x)\right )}{2 b} \]
[In]
[Out]
Time = 0.49 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.69
method | result | size |
risch | \(-\frac {i d \,x^{2}}{2}+i c x +\frac {2 b d x \,{\mathrm e}^{2 i \left (x b +a \right )}-i d \,{\mathrm e}^{2 i \left (x b +a \right )}+2 b c \,{\mathrm e}^{2 i \left (x b +a \right )}-i d}{b^{2} \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )^{2}}+\frac {c \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}{b}-\frac {2 c \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b}-\frac {2 i d x a}{b}-\frac {i d \,a^{2}}{b^{2}}+\frac {d \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) x}{b}-\frac {i d \operatorname {polylog}\left (2, -{\mathrm e}^{2 i \left (x b +a \right )}\right )}{2 b^{2}}+\frac {2 d a \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}\) | \(183\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.56 \[ \int (c+d x) \tan ^3(a+b x) \, dx=\frac {2 \, b d x + 2 \, {\left (b d x + b c\right )} \tan \left (b x + a\right )^{2} + i \, d {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - i \, d {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) + 2 \, {\left (b d x + b c\right )} \log \left (-\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (b d x + b c\right )} \log \left (-\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 \, d \tan \left (b x + a\right )}{4 \, b^{2}} \]
[In]
[Out]
\[ \int (c+d x) \tan ^3(a+b x) \, dx=\int \left (c + d x\right ) \tan ^{3}{\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 517 vs. \(2 (89) = 178\).
Time = 0.44 (sec) , antiderivative size = 517, normalized size of antiderivative = 4.79 \[ \int (c+d x) \tan ^3(a+b x) \, dx=-\frac {b^{2} d x^{2} + 2 \, b^{2} c x - 2 \, {\left (b d x + b c + {\left (b d x + b c\right )} \cos \left (4 \, b x + 4 \, a\right ) + 2 \, {\left (b d x + b c\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (-i \, b d x - i \, b c\right )} \sin \left (4 \, b x + 4 \, a\right ) - 2 \, {\left (-i \, b d x - i \, b c\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + {\left (b^{2} d x^{2} + 2 \, b^{2} c x\right )} \cos \left (4 \, b x + 4 \, a\right ) + 2 \, {\left (b^{2} d x^{2} + 2 i \, b c + 2 \, {\left (b^{2} c + i \, b d\right )} x + d\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (d \cos \left (4 \, b x + 4 \, a\right ) + 2 \, d \cos \left (2 \, b x + 2 \, a\right ) + i \, d \sin \left (4 \, b x + 4 \, a\right ) + 2 i \, d \sin \left (2 \, b x + 2 \, a\right ) + d\right )} {\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) - {\left (-i \, b d x - i \, b c + {\left (-i \, b d x - i \, b c\right )} \cos \left (4 \, b x + 4 \, a\right ) - 2 \, {\left (i \, b d x + i \, b c\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (b d x + b c\right )} \sin \left (4 \, b x + 4 \, a\right ) + 2 \, {\left (b d x + b c\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - {\left (-i \, b^{2} d x^{2} - 2 i \, b^{2} c x\right )} \sin \left (4 \, b x + 4 \, a\right ) + 2 \, {\left (i \, b^{2} d x^{2} - 2 \, b c + 2 \, {\left (i \, b^{2} c - b d\right )} x + i \, d\right )} \sin \left (2 \, b x + 2 \, a\right ) + 2 \, d}{-2 i \, b^{2} \cos \left (4 \, b x + 4 \, a\right ) - 4 i \, b^{2} \cos \left (2 \, b x + 2 \, a\right ) + 2 \, b^{2} \sin \left (4 \, b x + 4 \, a\right ) + 4 \, b^{2} \sin \left (2 \, b x + 2 \, a\right ) - 2 i \, b^{2}} \]
[In]
[Out]
\[ \int (c+d x) \tan ^3(a+b x) \, dx=\int { {\left (d x + c\right )} \tan \left (b x + a\right )^{3} \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x) \tan ^3(a+b x) \, dx=\int {\mathrm {tan}\left (a+b\,x\right )}^3\,\left (c+d\,x\right ) \,d x \]
[In]
[Out]